package com.dao.front.Impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.dao.BaseDao;
import com.dao.front.IMusicFrontDao;
@Repository
public class MusicFrontDaoImpl extends BaseDao implements IMusicFrontDao {

	@Override
	public List<Map<String, Object>> findAll() {
		//以歌曲表为主，查询所有歌单，歌手，歌的类型，专辑
		String sql="select musicId,musicName,m.timeLength,m.musicMp3,m.musicTypeId,m.specialId,m.musicListId,m.singerId,"
       +" mt.musicTypeId,mt.musicTypeName,"
       +" sp.specialId,sp.specialName,"
       +" ml.musicListId,ml.musicListName,ml.musicListIntro,ml.musicListPhoto,"
       +" s.singerId,s.singerName"
       +" from music m"
       +" join musictype mt"
       +" on m.musicTypeId=mt.musicTypeId"
       +" join special sp"
       +" on m.specialId=sp.specialId"
       +" join musiclist ml"
       +" on m.musicListId=ml.musicListId"
       +" join singer s"
       +" on m.singerId=s.singerId";
		return executeQuery(sql, null);
	}

}
